/********************************************************************
	created:	2010/07/06
	created:	6:7:2010   16:52
	filename: 	D:\Proj\gcstock\code\C++\GCStock\GCMacro.h
	file path:	D:\Proj\gcstock\code\C++\GCStock
	file base:	GCMacro
	file ext:	h
	author:		Greg Song
	
	purpose:	Macro definition for GCStock project
*********************************************************************/

#ifndef _GCMACRO_H_
#define _GCMACRO_H_


#define IN 
#define OUT
#define INOUT


#define GC_TYPE_INT         1
#define GC_TYPE_WCHAR       2
#define GC_TYPE_WSTRING     3
#define GC_TYPE_FLOAT       4
#define GC_TYPE_ARRAY       5


typedef int ptrdiff_t;

#ifdef UNICODE
#define gccout std::wcout
#else
#define gccout std::cout
#endif // UNICODE
#define gcendl std::endl

#define GSASSERT(x) do{if(!(x)){gccout<<L"verify failed"<<gcendl;}}while(0)

#ifdef UNICODE
#define GCSTRTOL(x, y, z)   wcstol(x,y,z)
#define GCSTRLEN(x)         wcslen(x)
#define GCSTRNCMP(x,y,z)    wcsncmp(x,y,z)
#define GCSTRCMP(x,y)       wcscmp(x,y)
#define GCLTOSTR(x,y,z)     _ltow(x,y,z)
#else
#define GCSTRTOL(x, y, z)   strtol(x,y,z)
#define GCSTRLEN(x)         strlen(x)
#define GCSTRNCMP(x,y,z)    strncmp(x,y,z)
#define GCSTRCMP(x,y)       strcmp(x,y)
#define GCLTOSTR(x,y,z)     ltoa(x,y,z)
#endif // UNICODE

#ifdef UNICODE
#define _GCT(x) L##x
#else
#define _GCT(x) x
#endif UNICODE


#ifdef UNICODE
#define GCTestString std::wstring
#define GCSStream    std::wstringstream
#else
#define GCTestString std::string
#define GCSStream    std::stringstream
#endif // UNICODE

#endif //_GCMACRO_H_


